/**
 * Created with IntelliJ IDEA.
 * User: ajhin
 * Date: 6/9/14
 * Time: 8:29 AM
 * To change this template use File | Settings | File Templates.
 */
package
{
import com.societyGames.codeExercise.CodeExercise;

public function getMoveUpFunctionOnce():Function
{
  var robotReturnFunction:RobotReturnFunction = RobotReturnFunction(CodeExercise.instance);
  if (robotReturnFunction.hasGottenMoveUpFunction)
  {
    throw new Error("You cannot call getMoveDownFunctionOnce more than once.");
  }
  robotReturnFunction.hasGottenMoveUpFunction = true;
  return function ():void
  {
    robotReturnFunction.simulation.move(0, -1);
  }
}
}
